// 全局注册组件
import list from "./list.js"
// 取所有children
export const settings = ref({})
export default (app) => {
  list.forEach((item) => {
    item.children.forEach((child) => {
      import(`@/plugins/${child.name}/index.vue`).then((res) => {
        app.component(child.name, res.default)
      })
      import(`@/plugins/${child.name}/option.vue`).then((res) => {
        app.component(child.name + "-option", res.default)
      })
      import(`@/plugins/${child.name}/setting.js`).then((res) => {
        settings.value[child.name] = res.default
      })
    })
  })
}
